<template>
  <div class="date">
    <div class="block">
      <!-- <span class="demonstration">默认</span> -->
      <!-- {{ value }} -->
      <el-date-picker
        v-model="value"
        type="daterange"
        range-separator="-"
        start-placeholder="入住日期"
        end-placeholder="离店日期"
        :picker-options="pickerOptions"
        value-format="yyyy-MM-dd"
        @change="getDate"
      >
      </el-date-picker>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: "",
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
        },
      },
    };
  },
  methods: {
    getDate(v) {
      // console.log(v);
      this.$emit("getAllDate", v);
    },
  },
};
</script>

<style lang="less" scoped>
</style>